﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ledict.ConditionExtract.DAL;
using System.Data;
using Ledict.ConditionExtract.Model;


namespace Ledict.ConditionExtract.BLL
{
    public class AboutRegexBLL : IAboutRegexBLL
    {
        AboutRegexDAL regdal = new AboutRegexDAL();





        public bool AddReg_InfoUnit(Reg_InfoUnit Model)
        {

            return regdal.AddReg_InfoUnit(Model);
        }

        public DataTable Relation_GetReg_EI_Code(string id)
        {
            return regdal.Relation_GetReg_EI_Code(id);
        }

        /// <summary>
        /// 得到情形对应的正则ID(新版，根据来源名称和段落名称进行选择，而不是单一的通过信息单元)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable Relation_GetReg_EI_Code_Sql(string id)
        {
            return regdal.Relation_GetReg_EI_Code_Sql(id);
        }

        /// <summary>
        /// 获取正则关系表内容
        /// </summary>
        /// <param name="eiId"></param>
        /// <returns></returns>
        public List<Reg_InfoRegexRelation> GetRegexRelationByEiid(string eiId)
        {
            return regdal.GetRegexRelationByEiid(eiId);
        }

        /// <summary>
        /// 插入正则关系表内容
        /// </summary>
        /// <param name="ri"></param>
        /// <returns></returns>
        public bool InsertRegex(Reg_InfoRegexRelation ri)
        {
            return regdal.InsertRegex(ri);
        }

        /// <summary>
        /// 获取正则表内容
        /// </summary>
        /// <param name="eiId"></param>
        /// <returns></returns>
        public List<Reg_Regexs> GetReg_RegexsByEiid(string eiId)
        {
            return regdal.GetReg_RegexsByEiid(eiId);
        }

        /// <summary>
        /// 插入正则表内容
        /// </summary>
        /// <param name="ri"></param>
        /// <returns></returns>
        public bool InsertReg_Regexs(Reg_Regexs ri)
        {
            return regdal.InsertReg_Regexs(ri);
        }

    }
}
